<template>
  <div class="home">
  这是home页面----{{name}}
  <button @click="changeName">修改name的值</button>
  </div>
</template>

<script setup>
import { useStore } from "vuex";
import { computed } from "vue";
// postman - showdoc - swagger 他们都是对接口的描述或者调试工具 相当于接口文档
// 获取vue的name数据
let store = useStore();
// let name = computed(() => )
// console.log(store); 可以看到store中包含了vuex的所有的数据和方法
let name = computed(() => store.state.name);
const changeName = () => store.commit('changeName', "王五")
</script>
